<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style type="text/css">
    </style>
</head>
<body>
<div class="needAdd">
    <button class="b1">11</button>
</div>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script type="text/javascript">
    $(function(){
        /*$(".b2").click(function () {
            alert(22);
        });*/

        $(".needAdd").on("click",".b2",function () {
            alert(22);
        });

        //jquery添加元素
        $('.needAdd').append('<button class="b2">22</button>');

    });

</script>
</body>

</html>